package org.com.dk.dbutil;

public class SQLUtil {
	
	public final static String INSERT = "insert into " ;
	public final static String DELETE = "delete" ;
	public final static String UPDATE = "update" ;
	public final static String SELECT = "select" ;
	
	
	public static String getSaveSQL(String tablename,String temp) {
		StringBuffer sbf = new StringBuffer() ;
		sbf.append(INSERT) ;
		sbf.append(tablename) ;
		sbf.append(" value(") ;
		sbf.append(temp) ;
		sbf.append(")");
		return sbf.toString() ;
	}

	public static String getDeleteSQL(String tablename,String temp) {
		StringBuffer sbf = new StringBuffer() ;
		sbf.append(DELETE) ;
		sbf.append(tablename) ;
		sbf.append(" where ") ;
		sbf.append(temp) ;
		return sbf.toString() ;
	}
	
	public static String getUpdateSQL(String tablename,String temp) {
		StringBuffer sbf = new StringBuffer() ;
		sbf.append(UPDATE) ;
		sbf.append(tablename) ;
		sbf.append(" set ") ;
		sbf.append(temp) ;
		return sbf.toString() ;
	}
	
	public static String getSelectSQL(String colname,String tablename,String temp){
		StringBuffer sbf = new StringBuffer() ;
		sbf.append(SELECT) ;
		sbf.append(colname) ;
		sbf.append(" from ") ;
		sbf.append(tablename) ;
		sbf.append(temp);
		return sbf.toString() ;
	}
	
}
